import { createRouter, createWebHashHistory } from 'vue-router';

const indexList = () => import('../pages/index.vue');
const vueEditor = () => import('../components/vueEditor.vue');
const importMapEditor = () => import('../components/importMapEditor.vue');
const codeMirror = () => import('../codeMirror/index.vue');

const routes = [
  { path: '/', component: indexList, name: 'index' },
  { path: '/runVue', component: vueEditor, name: 'vueEditor' },
  { path: '/runImportMap', component: importMapEditor, name: 'importMapEditor' },
  { name: 'codeMirror', path: '/codeMirror', component: codeMirror },
];

const router = createRouter({
  history: createWebHashHistory(),
  routes,
});
export function setMetaContent(meta) {

  if (meta.title) document.title = meta.title

  // if (meta.keywords) document.querySelector('meta[name="keywords"]').setAttribute('content', meta.keywords)

  // if (meta.description) document.querySelector('meta[name="description"]').setAttribute('content', meta.description)

}
export default router; 